﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Mt.Site.Core.Base.Domain.Entities;
using Mt.Site.Core.Navigations;
using Mt.Site.Core.Synchronization;
using System;
using System.ComponentModel.DataAnnotations;

namespace Mt.Site.Core.ContentManagement.Entities
{
    public abstract class ContentBase : FullAuditedEntity<Guid>, IPassivable, IMenuId, IMustHaveTenant,
        ILanguage, INeedAuxiliaryId, IAutoSynchronous, ISynchronousSource
    {
        public const int MaxTitleLength = 350;
        public const int MaxStrLength = 500;

        public int TenantId { get; set; }
        public long MenuId { get; set; }

        [StringLength(10)]
        public string Language { get; set; }

        public long AuxiliaryId { get; set; }

        public bool IsActive { get; set; }

        [StringLength(50)]
        public string Key { get; set; }   //内容类型的customKey

        public int Hit { get; set; }    //点击量

        public long PublishTime { get; set; }


        [StringLength(MaxTitleLength)]
        public string Title { get; set; }

        public string Body { get; set; }    //正文一
        public string Body2 { get; set; }   //正文二

        public long Time1 { get; set; }  //为避免时区的差异，保存时间戳格式（单位为秒），0代表没有赋值

        public long Time2 { get; set; }

        public long Time3 { get; set; } 

        public long Time4 { get; set; }


        [StringLength(MaxStrLength)]
        public string Str1 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str2 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str3 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str4 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str5 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str6 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str7 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str8 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str9 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str10 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str11 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str12 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str13 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str14 { get; set; }

        [StringLength(MaxStrLength)]
        public string Str15 { get; set; }

        public bool Bool1 { get; set; }
        public bool Bool2 { get; set; }
        public bool Bool3 { get; set; }
        public bool Bool4 { get; set; }

        public int Int1 { get; set; }
        public int Int2 { get; set; }
        public int Int3 { get; set; }
        public int Int4 { get; set; }
        public int Int5 { get; set; }

        public decimal Double1 { get; set; }
        public decimal Double2 { get; set; }
        public decimal Double3 { get; set; }
        public decimal Double4 { get; set; }

        /// <summary>
        /// 自动同步（默认为ture）
        /// </summary>
        public bool AutoSynchronous { get; set; }

        /// <summary>
        /// 来源ID
        /// </summary>
        public Guid? SourceID { get; set; }

        public int Order { get; set; }     //排序号

        public bool IsHomeRecommend { get; set; }  //首页推荐

        /// <summary>
        /// 同MenuId一样，只用于保存信息当前所在栏目（因为专题这种形式的存在，光一个MenuId不够用）
        /// </summary>
        public Guid? RelateId { get; set; }  //关联数据id
    }
}
